home *** CD-ROM | disk | FTP | other *** search
- /* gendata2.c - generate test data for VIEW program */
- #include "stdio.h"
- #include "cminor.h"
-
- FILE *gfopen() ;
-
- main(argc,argv)
- int argc ;
- char *argv[] ;
- {
- long nc , i , nl ;
- char s[100] ;
- FILE *fp ;
-
- if( argc < 2 ) exit(1) ;
- fp = gfopen(argv[1],"w",BIN_MODE) ;
- if( fp == NULL ) exit(2) ;
-
- printf("number of characters / line :") ;
- scanf("%1d",&nl) ;
- nl = nl - 8 ; /* allow for line no. and CR/LF */
- for(i=0 ; i < nl ; i= i+1) /* set up string for line */
- { s[i] = ' ' + i ; }
- s[i] = '\0' ;
-
- printf("number of lines:") ;
- scanf("%1d",&nc) ;
-
- for(i=0 ; i < nc ; i= i+1 )
- { fprintf(fp,"%51d %s\r\n",i,s) ; }
- fclose(fp) ;
- }
-
-
-